//
//  replaykit-Bridging-Header.h
//  replaykit
//
//  Created by zhang on 2025/7/31.
//

#ifndef replaykit_Bridging_Header_h
#define replaykit_Bridging_Header_h

// 导入librtmp头文件
#import <librtmp/rtmp.h>

// 声明C函数，使其在Swift中可用
#ifdef __cplusplus
extern "C" {
#endif

// RTMP结构体
typedef struct RTMP RTMP;
typedef struct RTMPPacket RTMPPacket;

// RTMP函数声明
RTMP* RTMP_Alloc(void);
void RTMP_Free(RTMP* r);
void RTMP_Init(RTMP* r);
int RTMP_SetupURL(RTMP* r, char* url);
int RTMP_Connect(RTMP* r, RTMPPacket* cp);
int RTMP_ConnectStream(RTMP* r, int seekTime);
void RTMP_Close(RTMP* r);
void RTMP_EnableWrite(RTMP* r);
void RTMP_DeleteStream(RTMP* r);

// RTMP包函数
int RTMPPacket_Alloc(RTMPPacket* packet, int size);
void RTMPPacket_Free(RTMPPacket* packet);
int RTMP_SendPacket(RTMP* r, RTMPPacket* packet, int queue);

// 常量定义
#define RTMP_PACKET_TYPE_VIDEO 0x09
#define RTMP_PACKET_TYPE_AUDIO 0x08
#define RTMP_PACKET_TYPE_METADATA 0x12

#ifdef __cplusplus
}
#endif

#endif /* replaykit_Bridging_Header_h */ 